.class Lorg/zeam/Launcher$RenameFolderDialog;
.super Ljava/lang/Object;
.source "Launcher.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lorg/zeam/Launcher;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x2
    name = "RenameFolderDialog"
.end annotation


# instance fields
.field private mInput:Landroid/widget/EditText;

.field final synthetic this$0:Lorg/zeam/Launcher;


# direct methods
.method private constructor <init>(Lorg/zeam/Launcher;)V
    .locals 0
    .parameter

    .prologue
    .line 2134
    iput-object p1, p0, Lorg/zeam/Launcher$RenameFolderDialog;->this$0:Lorg/zeam/Launcher;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method synthetic constructor <init>(Lorg/zeam/Launcher;Lorg/zeam/Launcher$RenameFolderDialog;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 2134
    invoke-direct {p0, p1}, Lorg/zeam/Launcher$RenameFolderDialog;-><init>(Lorg/zeam/Launcher;)V

    return-void
.end method

.method static synthetic access$0(Lorg/zeam/Launcher$RenameFolderDialog;)V
    .locals 0
    .parameter

    .prologue
    .line 2198
    invoke-direct {p0}, Lorg/zeam/Launcher$RenameFolderDialog;->cleanup()V

    return-void
.end method

.method static synthetic access$1(Lorg/zeam/Launcher$RenameFolderDialog;)V
    .locals 0
    .parameter

    .prologue
    .line 2173
    invoke-direct {p0}, Lorg/zeam/Launcher$RenameFolderDialog;->changeFolderName()V

    return-void
.end method

.method private changeFolderName()V
    .locals 7

    .prologue
    const/4 v6, 0x0

    .line 2175
    iget-object v2, p0, Lorg/zeam/Launcher$RenameFolderDialog;->mInput:Landroid/widget/EditText;

    invoke-virtual {v2}, Landroid/widget/EditText;->getText()Landroid/text/Editable;

    move-result-object v2

    invoke-interface {v2}, Landroid/text/Editable;->toString()Ljava/lang/String;

    move-result-object v1

    .line 2176
    .local v1, name:Ljava/lang/String;
    invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v2

    if-nez v2, :cond_0

    .line 2178
    iget-object v2, p0, Lorg/zeam/Launcher$RenameFolderDialog;->this$0:Lorg/zeam/Launcher;

    invoke-static {}, Lorg/zeam/Launcher;->access$1()Lorg/zeam/LauncherModel;

    move-result-object v3

    iget-object v4, p0, Lorg/zeam/Launcher$RenameFolderDialog;->this$0:Lorg/zeam/Launcher;

    invoke-static {v4}, Lorg/zeam/Launcher;->access$2(Lorg/zeam/Launcher;)Lorg/zeam/FolderInfo;

    move-result-object v4

    iget-wide v4, v4, Lorg/zeam/FolderInfo;->id:J

    invoke-virtual {v3, v4, v5}, Lorg/zeam/LauncherModel;->findFolderById(J)Lorg/zeam/FolderInfo;

    move-result-object v3

    invoke-static {v2, v3}, Lorg/zeam/Launcher;->access$3(Lorg/zeam/Launcher;Lorg/zeam/FolderInfo;)V

    .line 2179
    iget-object v2, p0, Lorg/zeam/Launcher$RenameFolderDialog;->this$0:Lorg/zeam/Launcher;

    invoke-static {v2}, Lorg/zeam/Launcher;->access$2(Lorg/zeam/Launcher;)Lorg/zeam/FolderInfo;

    move-result-object v2

    iput-object v1, v2, Lorg/zeam/FolderInfo;->title:Ljava/lang/CharSequence;

    .line 2180
    iget-object v2, p0, Lorg/zeam/Launcher$RenameFolderDialog;->this$0:Lorg/zeam/Launcher;

    iget-object v3, p0, Lorg/zeam/Launcher$RenameFolderDialog;->this$0:Lorg/zeam/Launcher;

    invoke-static {v3}, Lorg/zeam/Launcher;->access$2(Lorg/zeam/Launcher;)Lorg/zeam/FolderInfo;

    move-result-object v3

    invoke-static {v2, v3}, Lorg/zeam/LauncherModel;->updateItemInDatabase(Landroid/content/Context;Lorg/zeam/ItemInfo;)V

    .line 2182
    iget-object v2, p0, Lorg/zeam/Launcher$RenameFolderDialog;->this$0:Lorg/zeam/Launcher;

    invoke-static {v2}, Lorg/zeam/Launcher;->access$4(Lorg/zeam/Launcher;)Z

    move-result v2

    if-eqz v2, :cond_1

    .line 2183
    invoke-static {}, Lorg/zeam/Launcher;->access$1()Lorg/zeam/LauncherModel;

    move-result-object v2

    iget-object v3, p0, Lorg/zeam/Launcher$RenameFolderDialog;->this$0:Lorg/zeam/Launcher;

    invoke-virtual {v2, v6, v3, v6}, Lorg/zeam/LauncherModel;->loadUserItems(ZLorg/zeam/Launcher;Z)V

    .line 2195
    :cond_0
    :goto_0
    invoke-direct {p0}, Lorg/zeam/Launcher$RenameFolderDialog;->cleanup()V

    .line 2196
    return-void

    .line 2185
    :cond_1
    iget-object v2, p0, Lorg/zeam/Launcher$RenameFolderDialog;->this$0:Lorg/zeam/Launcher;

    invoke-static {v2}, Lorg/zeam/Launcher;->access$5(Lorg/zeam/Launcher;)Lorg/zeam/Workspace;

    move-result-object v2

    iget-object v3, p0, Lorg/zeam/Launcher$RenameFolderDialog;->this$0:Lorg/zeam/Launcher;

    invoke-static {v3}, Lorg/zeam/Launcher;->access$2(Lorg/zeam/Launcher;)Lorg/zeam/FolderInfo;

    move-result-object v3

    invoke-virtual {v2, v3}, Lorg/zeam/Workspace;->getViewForTag(Ljava/lang/Object;)Landroid/view/View;

    move-result-object v0

    check-cast v0, Lorg/zeam/FolderIcon;

    .line 2186
    .local v0, folderIcon:Lorg/zeam/FolderIcon;
    if-eqz v0, :cond_2

    .line 2187
    invoke-virtual {v0, v1}, Lorg/zeam/FolderIcon;->setText(Ljava/lang/CharSequence;)V

    .line 2188
    iget-object v2, p0, Lorg/zeam/Launcher$RenameFolderDialog;->this$0:Lorg/zeam/Launcher;

    invoke-virtual {v2}, Lorg/zeam/Launcher;->getWorkspace()Lorg/zeam/Workspace;

    move-result-object v2

    invoke-virtual {v2}, Lorg/zeam/Workspace;->requestLayout()V

    goto :goto_0

    .line 2190
    :cond_2
    iget-object v2, p0, Lorg/zeam/Launcher$RenameFolderDialog;->this$0:Lorg/zeam/Launcher;

    const/4 v3, 0x1

    invoke-static {v2, v3}, Lorg/zeam/Launcher;->access$6(Lorg/zeam/Launcher;Z)V

    .line 2191
    invoke-static {}, Lorg/zeam/Launcher;->access$1()Lorg/zeam/LauncherModel;

    move-result-object v2

    iget-object v3, p0, Lorg/zeam/Launcher$RenameFolderDialog;->this$0:Lorg/zeam/Launcher;

    invoke-virtual {v2, v6, v3, v6}, Lorg/zeam/LauncherModel;->loadUserItems(ZLorg/zeam/Launcher;Z)V

    goto :goto_0
.end method

.method private cleanup()V
    .locals 2

    .prologue
    .line 2200
    iget-object v0, p0, Lorg/zeam/Launcher$RenameFolderDialog;->this$0:Lorg/zeam/Launcher;

    invoke-static {v0}, Lorg/zeam/Launcher;->access$5(Lorg/zeam/Launcher;)Lorg/zeam/Workspace;

    move-result-object v0

    invoke-virtual {v0}, Lorg/zeam/Workspace;->unlock()V

    .line 2201
    iget-object v0, p0, Lorg/zeam/Launcher$RenameFolderDialog;->this$0:Lorg/zeam/Launcher;

    const/4 v1, 0x3

    invoke-virtual {v0, v1}, Lorg/zeam/Launcher;->dismissDialog(I)V

    .line 2202
    iget-object v0, p0, Lorg/zeam/Launcher$RenameFolderDialog;->this$0:Lorg/zeam/Launcher;

    const/4 v1, 0x0

    invoke-static {v0, v1}, Lorg/zeam/Launcher;->access$0(Lorg/zeam/Launcher;Z)V

    .line 2203
    iget-object v0, p0, Lorg/zeam/Launcher$RenameFolderDialog;->this$0:Lorg/zeam/Launcher;

    const/4 v1, 0x0

    invoke-static {v0, v1}, Lorg/zeam/Launcher;->access$3(Lorg/zeam/Launcher;Lorg/zeam/FolderInfo;)V

    .line 2204
    return-void
.end method


# virtual methods
.method createDialog()Landroid/app/Dialog;
    .locals 7

    .prologue
    const/4 v6, 0x1

    .line 2140
    iget-object v3, p0, Lorg/zeam/Launcher$RenameFolderDialog;->this$0:Lorg/zeam/Launcher;

    invoke-static {v3, v6}, Lorg/zeam/Launcher;->access$0(Lorg/zeam/Launcher;Z)V

    .line 2141
    iget-object v3, p0, Lorg/zeam/Launcher$RenameFolderDialog;->this$0:Lorg/zeam/Launcher;

    const v4, 0x7f030014

    const/4 v5, 0x0

    invoke-static {v3, v4, v5}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v2

    .line 2142
    .local v2, layout:Landroid/view/View;
    const v3, 0x7f060024

    invoke-virtual {v2, v3}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v3

    check-cast v3, Landroid/widget/EditText;

    iput-object v3, p0, Lorg/zeam/Launcher$RenameFolderDialog;->mInput:Landroid/widget/EditText;

    .line 2144
    new-instance v0, Landroid/app/AlertDialog$Builder;

    iget-object v3, p0, Lorg/zeam/Launcher$RenameFolderDialog;->this$0:Lorg/zeam/Launcher;

    invoke-direct {v0, v3}, Landroid/app/AlertDialog$Builder;-><init>(Landroid/content/Context;)V

    .line 2145
    .local v0, builder:Landroid/app/AlertDialog$Builder;
    iget-object v3, p0, Lorg/zeam/Launcher$RenameFolderDialog;->this$0:Lorg/zeam/Launcher;

    const v4, 0x7f0a0054

    invoke-virtual {v3, v4}, Lorg/zeam/Launcher;->getString(I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v0, v3}, Landroid/app/AlertDialog$Builder;->setTitle(Ljava/lang/CharSequence;)Landroid/app/AlertDialog$Builder;

    .line 2146
    invoke-virtual {v0, v6}, Landroid/app/AlertDialog$Builder;->setCancelable(Z)Landroid/app/AlertDialog$Builder;

    .line 2147
    const/4 v3, 0x0

    invoke-virtual {v0, v3}, Landroid/app/AlertDialog$Builder;->setIcon(I)Landroid/app/AlertDialog$Builder;

    .line 2149
    new-instance v3, Lorg/zeam/Launcher$RenameFolderDialog$1;

    invoke-direct {v3, p0}, Lorg/zeam/Launcher$RenameFolderDialog$1;-><init>(Lorg/zeam/Launcher$RenameFolderDialog;)V

    invoke-virtual {v0, v3}, Landroid/app/AlertDialog$Builder;->setOnCancelListener(Landroid/content/DialogInterface$OnCancelListener;)Landroid/app/AlertDialog$Builder;

    .line 2155
    iget-object v3, p0, Lorg/zeam/Launcher$RenameFolderDialog;->this$0:Lorg/zeam/Launcher;

    const v4, 0x7f0a005a

    invoke-virtual {v3, v4}, Lorg/zeam/Launcher;->getString(I)Ljava/lang/String;

    move-result-object v3

    new-instance v4, Lorg/zeam/Launcher$RenameFolderDialog$2;

    invoke-direct {v4, p0}, Lorg/zeam/Launcher$RenameFolderDialog$2;-><init>(Lorg/zeam/Launcher$RenameFolderDialog;)V

    invoke-virtual {v0, v3, v4}, Landroid/app/AlertDialog$Builder;->setNegativeButton(Ljava/lang/CharSequence;Landroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;

    .line 2161
    iget-object v3, p0, Lorg/zeam/Launcher$RenameFolderDialog;->this$0:Lorg/zeam/Launcher;

    const v4, 0x7f0a0056

    invoke-virtual {v3, v4}, Lorg/zeam/Launcher;->getString(I)Ljava/lang/String;

    move-result-object v3

    new-instance v4, Lorg/zeam/Launcher$RenameFolderDialog$3;

    invoke-direct {v4, p0}, Lorg/zeam/Launcher$RenameFolderDialog$3;-><init>(Lorg/zeam/Launcher$RenameFolderDialog;)V

    invoke-virtual {v0, v3, v4}, Landroid/app/AlertDialog$Builder;->setPositiveButton(Ljava/lang/CharSequence;Landroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;

    .line 2168
    invoke-virtual {v0, v2}, Landroid/app/AlertDialog$Builder;->setView(Landroid/view/View;)Landroid/app/AlertDialog$Builder;

    .line 2169
    invoke-virtual {v0}, Landroid/app/AlertDialog$Builder;->create()Landroid/app/AlertDialog;

    move-result-object v1

    .line 2170
    .local v1, dialog:Landroid/app/AlertDialog;
    return-object v1
.end method
